package org.main.bean.POJO;


import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.NoArgsConstructor;
import lombok.*;

import javax.persistence.*;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.HashSet;
import java.util.Set;


/**
 * By： 土豆菌
 * 2019-02-28 19:14
 */
@Entity
@Getter
@Setter
@NoArgsConstructor
@Table(name = "theorder")
@JsonIgnoreProperties({"hibernateLazyInitializer","handler"})
public class Ptheorder implements java.io.Serializable{

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "OrderID")
    private int OrderID;
    @Column(name = "Ddtime")
    private String ddTime;
    @Column(name = "Ordershu")
    private int orderShu;
    @Column(name = "Yuanprice")
    private String Yuanprice;
    @Column(name = "Ordermoney")
    private String Ordermoney;
    @Column(name = "Ddstate")
    private String ddState;
    @Column(name = "OrderBZ")
    private String orderBz;
    @Column(name = "Confirm")
    private String confirm;

    public String getDdTime() {
        Timestamp ts = Timestamp.valueOf(ddTime);
        Calendar c = Calendar.getInstance();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日hh时mm分ss秒");
        return sdf.format(c.getTime());
    }

    public void setDdTime(String ddTime) {
        this.ddTime = ddTime;
    }

    @ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER)
    @JoinColumn(name = "OrderID",insertable = false, updatable = false)
    private Ptheorderxx ptheorderxx ;

}
